package com.tky.conference.ui;

import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.widget.TextView;

import com.tky.conference.R;
import com.tky.conference.base.BaseActivity;
import com.tky.conference.dao.AppointInfo;

/**
 * Created by yy on 2015/12/7.
 */
public class DetailActivity extends BaseActivity {

    private Toolbar toolbar;
    private AppointInfo appointInfo;
    private TextView subject,name,address,fzr,sqr,zbbm,chry,status,jlr,startTime,endTime;
    @Override
    public void initView() {
        setContentView(R.layout.activity_detail);
        subject= (TextView) findViewById(R.id.tv_subject);
        //会议室名称
        name= (TextView) findViewById(R.id.tv_name);
        //会议地点
        address= (TextView) findViewById(R.id.tv_address);
        fzr= (TextView) findViewById(R.id.tv_fzr);
        sqr= (TextView) findViewById(R.id.tv_sqr);
        //主办部门
        zbbm= (TextView) findViewById(R.id.tv_department);
        //参会人员
        chry= (TextView) findViewById(R.id.tv_chry);
        //
        status= (TextView) findViewById(R.id.tv_status);

        jlr= (TextView) findViewById(R.id.tv_jlr);
        startTime= (TextView) findViewById(R.id.tv_startTime);
        endTime= (TextView) findViewById(R.id.endTime);

    }

    @Override
    public void initDates() {
        appointInfo= (AppointInfo) getIntent().getSerializableExtra("APPINFO");
        subject.setText(appointInfo.getHyzt());
        name.setText(appointInfo.getHysmc());
        address.setText(appointInfo.getHydd());
        fzr.setText(appointInfo.getFzr());
        sqr.setText(appointInfo.getSqr());
        zbbm.setText(appointInfo.getZbbm());
        chry.setText(appointInfo.getChry());
        status.setText(appointInfo.getStatus());
        jlr.setText(appointInfo.getJlr());
        startTime.setText(appointInfo.getStime());
        endTime.setText(appointInfo.getEtime());

    }

    @Override
    public void initToolBar() {
        toolbar= (Toolbar) findViewById(R.id.toolbar);
        if (toolbar!=null){
            toolbar.setTitle("会议详情");
        }
        setSupportActionBar(toolbar);
    }

    @Override
    public void initEvent() {

    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId()==android.R.id.home){
            finish();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}
